<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ page import="crm.model.Salearea" %>
<%@ page import="crm.control.SaleareaControl"%>
<%@ page import="java.util.*"  %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>修改销售区域</title>
  </head>
  
  <body>
    		<%
				request.setCharacterEncoding("UTF-8");
				SaleareaControl sc = new SaleareaControl();
				int id = Integer.parseInt(request.getParameter("id"));
				String area_name = request.getParameter("area_name");
				String sale_target = request.getParameter("sale_target");
				String competitor = request.getParameter("competitor");				
				
				Salearea salearea = new Salearea();
				salearea.setArea_name(area_name);
				salearea.setSale_target(sale_target);
				salearea.setCompetitor(competitor);
				
				if (sc.updateSalearea(salearea, id)) {
					
		%>
	 <script language = "javascript">
if(window.confirm("更新成功！"))
window.location.href = "salearea.jsp";
else
window.location.href = "salearea.jsp";
</script>
<%} else { %>
<script language="javascript">
if(window.confirm("更新失败！"))
window.location.href = "salearea.jsp";
else
window.location.href = "salearea.jsp";
</script>
		<%
	  		}
		%>
  </body>
</html>
